<?php

/**
 * Get validation error for field
 * 
 * @package Rapide_View
 *
 */
class Rapide_View_Helper_Validation extends Rapide_View_Helper
{
	public function execute($sParameter)
	{
		if(isset($this->getView()->errors))
		{
			$aErrors = $this->getView()->errors;

			if(is_array($aErrors) && array_key_exists($sParameter, $aErrors))
			{
					return !empty($aErrors[$sParameter]) ? $aErrors[$sParameter] : null;
			}
		}
	}
}

?>